<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.zmht.specedu.vo.Fengongtype,com.zmht.specedu.vo.Teacher,com.zmht.specedu.senate.web.form.TeacherForm"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
	/**
	 * @author 张天兴
	 * @since 2009/04/23
	 */

 %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>聋校语言学习及矫治系统</title>
<link href="<%=request.getContextPath() %>/reference/datePicker/skin/WdatePicker.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="<%=request.getContextPath() %>/reference/js/jquery.js"></script>
<script src="<%=request.getContextPath() %>/reference/WebCalendar.js" type="text/javascript"></script>

<fmt:setBundle basename="PathResource" scope="session" />
<link href="<%=request.getContextPath()%>/<fmt:message key='StylePath' />style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript"
	src="<fmt:message key='datePicker' />WdatePicker.js"></script>

<script src="<%=request.getContextPath()%>/<fmt:message key='JavaScriptPath' />validate.js"></script>
<script type="text/javascript">
 function check(obj)
 {
            if(document.forms[0].tname.value==""){
				alert("请输入教师姓名！");
				document.forms[0].tname.focus();
				return false;
			}
			if(document.forms[0].tbirthday.value==""){
				alert("请输入出生日期!");
				document.forms[0].tbirthday.focus();
				return false;
			}			
			if(document.forms[0].workTime.value==""){
				alert("请输入工作时间,必须是正整数1-99！！");
				document.forms[0].workTime.focus();
				return false;
			}			 
			  var regw =  /^\+?[1-9][0-9]*$/;　　//正整数 
			  var workTime=document.forms[0].workTime.value;
	            if(!regw.test(workTime) || workTime>99){
	             alert("工作时间格式不正确，必须是1-99之间的一个值!");
	             return false;
	             }								
             var teachProcess=document.forms[0].teachProcess.value;  
			 if(teachProcess.length>200){
	             alert("教学经历格式不正确,只允许200字以内!");
	             return false;
	             }		       
			   var rongYu=document.forms[0].rongYu.value;  
			 if(rongYu.length>200){
	             alert("曾获荣誉格式不正确,只允许200字以内!");
	             return false;
	             }		              
      //document.forms[0].submit();
  
     return Validator.Validate(obj,3);
  
 } 
		function MyReset(){
		var $all = document.all; 
		for(var i=0;i<$all.length;i++) 
		{ 
		if($all[i].tagName=="input") 
		$all[i].value=""; 
		} }

 
</script>
<%
Map<String,String> mapping = Teacher.dutyMapping;
TeacherForm teacherForm = (TeacherForm)request.getAttribute("teacherForm");
%>
</head>
<body  class="bcolor">
<form action="teacherAction.do" method="post"  onsubmit="return check(this);">
  <input type=hidden name="method" value="update" />
  <html:hidden name="teacherForm" property="teacherId"/>
     
   <table cellspacing="0" cellpadding="0" width="99%" align="center" border="0">
    <tbody>
      <tr>
        <td width="7"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_01.gif"  width="7" /></td>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_05.gif"><table cellspacing="0" cellpadding="0" width="100%" border="0">
            <tbody>
              <tr>
                <td width="30"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_02.gif" 
            width="30" /></td>
                <td align="left" width="200" 
            background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_03.gif">&nbsp;<b>编 辑 教 师 </b></td>
                <td width="59"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_04.gif" 
            width="59" /></td>
                <td>&nbsp;</td>
              </tr>
            </tbody>
        </table></td>
        <td width="8"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_06.gif" 
      width="8" /></td>
      </tr>
      <tr>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_07.gif"><img height="1" 
      src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />spacer.gif" width="1" /></td>
        <td bgcolor="#f7fbff"><table cellspacing="0" bordercolordark="#ccccff" cellpadding="0" width="100%" bordercolorlight="#ffffff" border="0">
            <tbody>
              <tr bgcolor="#a4c9ec">
                <td align="middle"><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                    <tr>
                      <td width="20%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">教师姓名：</td>
                      <td height="20" align="left" valign="middle" bgcolor="#FFFFFF">
                     <input type=text name="tname" class="boxcopy2" style="width:100px;" dataType="Require" msg="教师姓名必须填写" value="<bean:write name="teacherForm" property="tname" />"   maxlength="10"/>
                     <span class="STYLE4">*</span></td>
                    </tr>
                </table></td>
              </tr>
              <tr bgcolor="#ffffff">
                <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                    <tr>
                      <td width="20%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">性 别：</td>
                      <td height="20" align="left" valign="middle" bgcolor="#FFFFFF"><input type="radio" name="sex" id="radio" value="男" <%if(teacherForm.getSex()!=null && teacherForm.getSex().equals("男")){out.print("checked");} %>/>
                        男
                        <input type="radio" name="sex" id="radio2" value="女" <%if(teacherForm.getSex()!=null && teacherForm.getSex().equals("女")){out.print("checked");} %>/>
                        女</td>
                    </tr>
                </table></td>
              </tr>
              <tr bgcolor="#ffffff">
                <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                    <tr>
                      <td width="20%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">出生日期：</td>
                      <td height="20" align="left" valign="middle" bgcolor="#FFFFFF">
                        <input name="tbirthday" type="text" id="textfield18" value="<c:out value="${teacherForm.tbirthday}" />"
						class="Wdate" onClick="SelectDate(this,'yyyy-MM-dd')"  style="width:100px;" maxlength="4"/>
                    <span class="STYLE4">*</span></td>
                    </tr>
                </table></td>
              </tr>
              <tr bgcolor="#ffffff">
                <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                    <tr>
                      <td width="20%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">工作时间：</td>
                      <td height="20" align="left" valign="middle" bgcolor="#FFFFFF">
                      <input type=text name="workTime"  class="boxcopy2" style="width:100px;" dataType="Integer" msg="必须是整数" value="<bean:write name="teacherForm" property="workTime" />"/>
                 年 <span class="STYLE4">*</span>(必须是正整数,如:1或者12) </td>
                    </tr>
                </table></td>
              </tr>
              <tr bgcolor="#ffffff">
                <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                    <tr>
                      <td width="20%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">学 历：</td>
                      <td height="20" align="left" valign="middle" bgcolor="#FFFFFF">
               <select name="xueLi" class="boxcopy2"  style="width:104px;">
                  <option <logic:equal name="teacherForm" property="xueLi" value="大专"> selected </logic:equal>>大专</option>
                  <option <logic:equal name="teacherForm" property="xueLi" value="大学"> selected </logic:equal>>大学</option>
                  <option <logic:equal name="teacherForm" property="xueLi" value="硕士"> selected </logic:equal>>硕士</option>
                  <option <logic:equal name="teacherForm" property="xueLi" value="博士"> selected </logic:equal>>博士</option>
                </select>
                      </td>
                    </tr>
                </table></td>
              </tr>
              <tr bgcolor="#ffffff">
                <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                    <tr>
                      <td width="20%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">职 称：</td>
                      <td height="20" align="left" valign="middle" bgcolor="#FFFFFF">
<input type=text name="position" Class="boxcopy2" style="width:100px;" value="<bean:write name="teacherForm" property="position" />"   maxlength="40" />
                      </td>
                    </tr>
                </table></td>
              </tr>

              <tr bgcolor="#ffffff">
                <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                    <tr>
                      <td width="20%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">专业方向：</td>
                      <td height="20" align="left" valign="middle" bgcolor="#FFFFFF"><input name="specDirect" type="text" class="boxcopy2" id="textfield2"  style="width:100px;"  maxlength="90" value="<bean:write name="teacherForm" property="specDirect" />"/></td>
                    </tr>
                </table></td>
              </tr>
              <tr bgcolor="#ffffff">
                <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                    <tr>
                      <td width="20%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">专业特长：</td>
                      <td height="20" align="left" valign="middle" bgcolor="#FFFFFF"><input type=text name=special Class="boxcopy2" style="width:100px;"  maxlength="90"  value="<bean:write name="teacherForm" property="special" />"/></td>
                    </tr>
                </table></td>
              </tr>
              <tr bgcolor="#ffffff">
                <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                    <tr>
                      <td width="20%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">教学经历：</td>
                      <td height="20" align="left" valign="middle" bgcolor="#FFFFFF">
                      <textarea name="teachProcess" rows="5" class="boxcopy2" id="textfield9" style="width:300px;"  onpropertychange="if(value.length>125) value=value.substr(0,125)"><bean:write name="teacherForm" property="teachProcess" /></textarea>
                      (200字以内)</td>
                    </tr>
                </table></td>
              </tr>
              <tr bgcolor="#ffffff">
                <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                    <tr>
                      <td width="20%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">曾获荣誉：</td>
                      <td height="20" align="left" valign="middle" bgcolor="#FFFFFF">
                      <textarea name="rongYu" rows="5" class="boxcopy2" id="textfield8" style="width:300px;"  onpropertychange="if(value.length>125) value=value.substr(0,125)"><bean:write name="teacherForm" property="rongYu" /></textarea>
                      (200字以内)</td>
                    </tr>
                </table></td>
              </tr>
              <tr bgcolor="#ffffff">
                <td bgcolor="#ffffff"><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                  <tr>
                    <td width="20%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">分工类别：</td>
                    <td height="20" align="left" valign="middle" bgcolor="#FFFFFF">

                   <html:select name="teacherForm" property="fengongType"   styleClass="boxcopy2"  style="width:104px;">
                   <html:optionsCollection name="list" label="name" value="id"/>
                  </html:select>       
                    
                    </td>
                  </tr>
                </table></td>
              </tr>
              <tr bgcolor="#ffffff">
                <td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" class="fontbot">
                  <tr>
                    <td width="20%" height="20" align="right" valign="middle" bgcolor="#e6f0f8">责任类别：</td>
                    <td height="20" align="left" valign="middle" bgcolor="#FFFFFF">
                  <select name="zeRenType" class="boxcopy2"  style="width:104px;">
                  <%
							for(String s : mapping.keySet()){
						%>
							<option <%if(teacherForm.getZeRenType()!=null && teacherForm.getZeRenType().equals(s)){out.print("selected");} %> value="<%=s %>" ><%=mapping.get(s) %></option>
						<%
							}
						%>
                                </select>
                    </td>
                  </tr>
                </table></td>
              </tr>
                                       
            </tbody>
          </table>
            <table cellspacing="1" cellpadding="0" width="100%" bgcolor="#ffffff" 
        border="0">
              <tbody>
                <tr>
                  <td align="middle" bgcolor="#e6f0f8"><table cellspacing="0" cellpadding="3" width="100%" border="0">
                      <tbody>
                        <tr>
                          <td width="50%" align="right"><input type="image" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />jz_img/xiugai.gif" width="53" height="22" border="0" /></td>
                          <td width="50%" align="left"><a href="javascript:document.forms[0].reset();" onfocus="this.blur()"><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />gif-02.gif" width="53" height="22" border="0" /></a></td>
                        </tr>
                      </tbody>
                  </table></td>
                </tr>
              </tbody>
          </table></td>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_09.gif"><img height="1" 
      src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />spacer.gif" width="1" /></td>
      </tr>
      <tr>
        <td><img height="22" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_10.gif" width="7" /></td>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_11.gif">&nbsp;</td>
        <td><img height="22" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_12.gif" 
  width="8" /></td>
      </tr>
    </tbody>
  </table>
     
</form>
</body>
</html>
